﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;

namespace HandLab.Mvc3App.Aspx.Controllers.Filters
{
    public class LoggingFilter:FilterAttribute,IActionFilter
    {
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {
            filterContext.Controller.ViewData["ExecutingLogger"] = string.Format("正在添加公告，已经写入日志！时间：{0}", DateTime.Now);
        }

        public void OnActionExecuting(ActionExecutingContext filterContext)
        {
            filterContext.Controller.ViewData["ExecutedLogger"] = string.Format("已经添加公告，已经写入日志！时间：{0}", DateTime.Now);
        }
    }
}